<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简易ATM取钱</title>
</head>

<body>
    <script>

        let money = 0;
        while (true) {
            let result = +prompt(`
                请您选中操作:
                1.存钱
                2.取钱
                3.查看余额
                4.退出
                `);
            if (result === 1) {
                let cun = +prompt("请输入额度");
                money += cun;
                console.log("存钱" + money);
            } else if (result === 2) {
                let qu = +prompt("请输入额度");
                money -= +qu;
                console.log("取钱" + money);
            } else if (result === 3) {
                alert(`当前余额为：${money}`)
            } else {
                console.log("退出");
                break;
            }

        }

    </script>
</body>

</html>